<template>
	<view>
			<view v-for="(item, index) in goodsList" v-bind:key="item.id" style="border: 1px solid #c3c3c3; margin: 5px 10px;">
				<view style="height: 100px; padding: 10px; ">
					<image src="../../static/likeFx/1.png" style="width: 50px;height:50px;"></image>
					<view>
						{{ item.goodsTitle }}
						<text style="color: #727576;">{{ item.description }}</text>
						<button style="float: right;" type="warn" size="mini" disabled>购买</button>
					</view>
				</view>
			</view>
	</view>
</template>

<script>
import uniPagination from '@/components/uni-pagination/uni-pagination.vue';
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';

export default {
	components: {
		uniPagination,
		uniNumberBox
	},
	data() {
		return {
			userInfo: null,
			goodsList: [
			]
		};
	},
	onShow(){
		this.getGoods();
	},
	methods: {
		// 获取所有商品
		getGoods() {
			let that = this;
			that.$request('/ticketGoods', 'get').then(result => {
				let goodsList = [];
				result.data.forEach(e => {
					if(e.sellStatus)
						goodsList.push(e);
				})
				that.goodsList = goodsList;
			});
		}
	}
};
</script>

<style></style>
